package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;
import java.time.Instant;

/**
 * 配送员上下线日志表
 */
@ApiModel(description = "配送员上下线日志表")
@Entity
@Table(name = "courier_online_log")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class CourierOnlineLog implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 配送员编码
     */
    @ApiModelProperty(value = "配送员编码")
    @Column(name = "courier_code")
    private String courierCode;

    /**
     * 上线、下线
     */
    @ApiModelProperty(value = "上线、下线")
    @Column(name = "jhi_type")
    private String type;

    /**
     * 上下线时间
     */
    @ApiModelProperty(value = "上下线时间")
    @Column(name = "jhi_time")
    private Instant time;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getCourierCode() {
        return courierCode;
    }

    public CourierOnlineLog courierCode(String courierCode) {
        this.courierCode = courierCode;
        return this;
    }

    public void setCourierCode(String courierCode) {
        this.courierCode = courierCode;
    }

    public String getType() {
        return type;
    }

    public CourierOnlineLog type(String type) {
        this.type = type;
        return this;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Instant getTime() {
        return time;
    }

    public CourierOnlineLog time(Instant time) {
        this.time = time;
        return this;
    }

    public void setTime(Instant time) {
        this.time = time;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof CourierOnlineLog)) {
            return false;
        }
        return id != null && id.equals(((CourierOnlineLog) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "CourierOnlineLog{" +
            "id=" + getId() +
            ", courierCode='" + getCourierCode() + "'" +
            ", type='" + getType() + "'" +
            ", time='" + getTime() + "'" +
            "}";
    }
}
